home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / c.dxr / 00013_NEW for shared.dir.ls < prev    next >
Encoding:
Text File  |  1996-02-15  |  1.7 KB  |  42 lines

  1. global gStates, gObjects, gCurKeyList, gWorld, void, gCursorPresent, gHitMaps, sCURSORSPRITE, cNullCast
  2.  
  3. on turnOnObj OBJref
  4.   if (OBJref = #describe) or voidp(OBJref) then
  5.     put "this turns on and off all of an object's children -k"
  6.     put "use syntax: turnOnObj #thermometerObj --passing a symbol"
  7.     exit
  8.   end if
  9.   set thisObj to getaProp(gObjects, OBJref)
  10.   set parentState to the State of thisObj
  11.   set myChildren to the Children of thisObj
  12.   set howmany to count(myChildren)
  13.   repeat with thisChildRef in myChildren
  14.     set thisChildObj to getaProp(gObjects, thisChildRef)
  15.     if parentState = #off then
  16.       setaProp(thisChildObj, #DisplayState, #false)
  17.       next repeat
  18.     end if
  19.     if getaProp(thisChildObj, #type) = #animator then
  20.       displayObj(getaProp(thisChildObj, #RefName))
  21.       next repeat
  22.     end if
  23.     if getaProp(thisChildObj, #type) = #animatorParent then
  24.       displayObj(getaProp(thisChildObj, #State))
  25.       next repeat
  26.     end if
  27.     if (getaProp(thisChildObj, #type) <> #Parent) and (getaProp(thisChildObj, #type) <> #Hotrect) then
  28.       if not voidp(getaProp(thisChildObj, #State)) then
  29.         MakeDynamic(thisChildRef, #DisplayState, getaProp(thisChildObj, #State))
  30.       else
  31.         alert("this object has no State")
  32.       end if
  33.       if listp(getaProp(getaProp(thisChildObj, #cast), getaProp(thisChildObj, #DisplayState))) then
  34.         set the castNum of sprite getaProp(thisChildObj, #SpriteNum) to getAt(getaProp(getaProp(thisChildObj, #cast), getaProp(thisChildObj, #DisplayState)), 1)
  35.         next repeat
  36.       end if
  37.       set the castNum of sprite getaProp(thisChildObj, #SpriteNum) to getaProp(getaProp(thisChildObj, #cast), getaProp(thisChildObj, #DisplayState))
  38.     end if
  39.   end repeat
  40.   return parentState
  41. end
  42.